package cn.edu.scau.cmi.zengdefeng.Singleton;

import javafx.fxml.FXML;
import javafx.scene.control.Button;
import javafx.scene.control.Label;
import javafx.scene.control.TableColumn;
import javafx.scene.control.TableView;
import javafx.scene.control.TextArea;
import javafx.scene.control.TextField;
import singletonClient.SingletonClient;
import cn.edu.scau.cmi.zengdefeng.Singleton.*;;
public class controller {
	@FXML
	private TextField chairman;
	@FXML
	private TextField marshal;
	@FXML
	private TextArea text;
	@FXML
	private Button setChairman;
	@FXML
	private Button setMarshal;
	
	@FXML
	void setChair() {
		String chair=chairman.getText();
		Chairman chairman=Chairman.getFlag(chair);
		chair=chairman.getName();
		text.appendText(chair.toString()+chairman.toString()+"\n");
		
	}
	@FXML
	void setMar() {
		String mar=marshal.getText();
		Marshal marshal=Marshal.getFlag(mar);
		mar=marshal.getName();
		if(marshal.getCount()>10)
			text.appendText("只能有10个元帅");
		else
		text.appendText(mar.toString()+marshal.toString()+"\n");
	}


}
